﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace LibFriesland_Campina_CRM
{
    public class BizManagerMonitoring
    {
        #region Thuoc tinh
        public long manager_action_numid { get; set; }
        public DateTime datetime_action { get; set; }
        public DateTime datetime_monitoring { get; set; }
        public string action_monitoring { get; set; }
        public string comment_monitoring { get; set; }
        public string by_sup { get; set; }
        public string by_manager { get; set; }
        #endregion

        #region Ham thiet lap
        public BizManagerMonitoring() { }
        public BizManagerMonitoring(long pManager_action_numid, DateTime pDatetime_action, DateTime pDatetime_monitoring, string pAction_monitoring, string pComment_monitoring, string pBy_sup, string pBy_manager)
        {
            manager_action_numid = pManager_action_numid;
            datetime_action = pDatetime_action;
            datetime_monitoring = pDatetime_monitoring;
            action_monitoring = pAction_monitoring;
            comment_monitoring = pComment_monitoring;
            by_sup = pBy_sup;
            by_manager = pBy_manager;
        }
        #endregion

        #region Phuong thuc
        //Them ManagerMonitoring
        public int addManagerMonitoring()
        {
            return DalManagerMonitoring.addManagerMonitoring(this);
        }

        //Lay danh sach Action cua Manager
        public static List<BizManagerMonitoring> getSupMonitoringbyManager(DateTime pDatetime_tracking, string pBy_sup, string pBy_manager)
        {
            return DalManagerMonitoring.getSupMonitoringbyManager(pDatetime_tracking, pBy_sup, pBy_manager);
        }
        #endregion
    }

    public class ManagerMonitoringSort : IComparable<BizManagerMonitoring>
    {
        public int CompareTo(BizManagerMonitoring other) { return 1; }
        public static Comparison<BizManagerMonitoring> dateComparison =
               delegate(BizManagerMonitoring p1, BizManagerMonitoring p2)
               {
                   return p1.datetime_monitoring.CompareTo(p2.datetime_monitoring);
               };
    }
}
